package com.huitone.gddw.service.dto.analysis.longsms;

import java.util.Date;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;
import com.huitone.gddw.utils.SysLoginUtil;

/**
 * 超长短信明细
 * @author wuluodan
 *
 */
public class LongSmsRecDTO {

	private String recId;
	
	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "30")
	private Integer seq;
	
	@ColToProperty
	@TabCol(Index = 2, title = "短信发送时间", width = "150")
	private Date sendTime;
	
	@ColToProperty
	@TabCol(Index = 3, title = "短信序号", width = "120")
	private String smSeq;
	
	@ColToProperty
	@TabCol(Index = 4, title = "手机号码", width = "90")
	private String userNo;
	
//	@ColToProperty
//	@TabCol(Index = 5, title = "来源端", width = "90")
//	private String smFrom;
	
	private String svrNode;
	
	@ColToProperty
	@TabCol(Index = 3, title = "业务端", width = "90")
	private String svrNodeName;
	
	private String serviceCode;

	@ColToProperty
	@TabCol(Index = 6, title = "业务类型", width = "90")
    private String serviceName;
    
    private String gateLinkId;
    
    @ColToProperty
	@TabCol(Index = 7, title = "发送通道", width = "90")
    private String gateLinkName;
    
    @ColToProperty
	@TabCol(Index = 8, title = "发送端口", width = "50")
    private String sendport;
    
    @ColToProperty
	@TabCol(Index = 9, title = "短信内容", width = "150")
    private String smContent;
    
    @ColToProperty
	@TabCol(Index = 10, title = "最短短信长度", width = "75")
    private String lastLength;
    
    @ColToProperty
	@TabCol(Index = 11, title = "发送结果", width = "50")
    private String sendMsg;

	public String getRecId() {
		return recId;
	}

	public void setRecId(String recId) {
		this.recId = recId;
	}
	
	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public String getSmSeq() {
		return smSeq;
	}

	public void setSmSeq(String smSeq) {
		this.smSeq = smSeq;
	}

	public String getUserNo() {
		return userNo;
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

//	public String getSmFrom() {
//		return smFrom;
//	}
//
//	public void setSmFrom(String smFrom) {
//		this.smFrom = smFrom;
//	}

	public String getSvrNode() {
		return svrNode;
	}

	public void setSvrNode(String svrNode) {
		this.svrNode = svrNode;
	}

	public String getSvrNodeName() {
		return svrNodeName;
	}

	public void setSvrNodeName(String svrNodeName) {
		this.svrNodeName = svrNodeName;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getServiceName() {
		return serviceName;
	}

	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	public String getGateLinkId() {
		return gateLinkId;
	}

	public void setGateLinkId(String gateLinkId) {
		this.gateLinkId = gateLinkId;
	}

	public String getGateLinkName() {
		return gateLinkName;
	}

	public void setGateLinkName(String gateLinkName) {
		this.gateLinkName = gateLinkName;
	}

	public String getSendport() {
		return sendport;
	}

	public void setSendport(String sendport) {
		this.sendport = sendport;
	}

	public String getSmContent() {
		return smContent == null ? "" : SysLoginUtil.isAdmin() ? smContent : getLikeContent(smContent);
	}
	
	private String getLikeContent(String content) {
		if (content.length() < 3) {
			return content;
		}
		StringBuffer sb = new StringBuffer("****** ");
		sb.append(content.substring(content.length() / 3, content.length() / 3 * 2));
		sb.append(" ******");
		return sb.toString();
	}

	public void setSmContent(String smContent) {
		this.smContent = smContent;
	}

	public String getLastLength() {
		return lastLength;
	}

	public void setLastLength(String lastLength) {
		this.lastLength = lastLength;
	}

	public String getSendMsg() {
		return sendMsg;
	}

	public void setSendMsg(String sendMsg) {
		this.sendMsg = sendMsg;
	}
	
}
